home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / cuj1008.zip / 1008069B < prev    next >
Text File  |  1992-05-28  |  2KB  |  45 lines

  1.  
  2. /*
  3. Postman's Sort (R) Version 1.0
  4. Copyright (c) Robert Ramey 1991. All Rights Reserved
  5. */
  6.  
  7. /*********************************************************************
  8. data structure for collating sequence values
  9. **********************************************************************/
  10. typedef struct {
  11.     unsigned int
  12.         order,        /* highest value in table */
  13.         value[256];    /* table of weights fore 256 possible bytes */
  14. } SEQ;
  15.  
  16. /*********************************************************************
  17. data structure and storage for holding keys as specified in the
  18. command line
  19. **********************************************************************/
  20.  
  21. /* structure for a key */
  22. typedef struct {
  23.     unsigned int rfield;    /* index of field within record */
  24.     unsigned int disp;        /* starting point of key with in field */
  25.     unsigned int size;        /* maximum size of key */
  26.     unsigned int key_type;    /* flag to indicate type of field */
  27.     BOOLEAN inverted;        /* reverse the sense of sort for this key */
  28.     SEQ *seq;        /* pointer to structure of collating values */
  29. } KEY;
  30.  
  31. #define DEFAULT    0    /* default type of alphanumeric key */
  32. #define SIGN 1        /* an optional 1 character sign */
  33. #define NUMERIC 2    /* digits to be expanded to fixed width */
  34. #define FRACTION 3    /* fractional part of a number */
  35.  
  36. extern KEY key[];    /* table of keys specified in command line */
  37. extern unsigned int
  38.     key_count, /* number of keys */
  39.     tab_count;
  40. extern size_t
  41.     *tab,
  42.     data_offset,
  43.     record_offset;
  44. #define blk_offset (record_offset-1)
  45.